import request from '@/utils/request'
/**
 *获取评论或评论回复
 * @param {*} type 评论类型
 * @param {*} source
 * @returns promise
 */
export const getCommentAPI = (params) =>
  request({
    url: '/v1_0/comments',
    method: 'GET',
    params
  })
/**
 * 发布评论
 * @param {*} data
 * @returns promise
 */
export const putCommentAPI = (data) =>
  request({
    url: '/v1_0/comments',
    method: 'POST',
    data
  })
/**
 * 对文章进行点赞
 * @param {*} target
 * @returns
 */
export const CommentLikingsAPI = (target) =>
  request({
    url: '/v1_0/comment/likings',
    method: 'POST',
    data: {
      target
    }
  })

export const noCommentLikingsAPI = (target) =>
  request({
    url: `/v1_0/comment/likings/${target}`,
    method: 'DELETE'
  })
